package createModel.BuilderModel.directorBuilderPlayers02;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 功能描述:
 * 功能描述:基本配置自动构建器, 校验后三个参数
 * 2024/06/10
 * <p>
 * <p>
 * 2024/06/10
 *
 * @author ZhangYi
 * @see AbstaractBasicConfigBuilder
 */
public class BasicConfigAutomaticBuilder extends AbstaractBasicConfigBuilder{
    @Override
    public void buildId(long id) throws Exception {
        basicConfig.setId(id);
    }

    @Override
    public void buildReductionEmissionFactorId(String reductionEmissionFactorId) throws Exception {
        basicConfig.setReductionEmissionFactorId(reductionEmissionFactorId);

    }

    @Override
    public void buildEmissionFactorName(String missionFactorName) throws Exception {

        basicConfig.setEmissionFactorName(missionFactorName);
    }

    @Override
    public void buildFactorLibraryId(String factorLibraryId) throws Exception {
        basicConfig.setFactorLibraryId(factorLibraryId);
    }

    @Override
    public void buildGhgTypeCode(List<String> ghgTypeCode) throws Exception {

        basicConfig.setGhgTypeCode(ghgTypeCode);
    }

    @Override
    public void buildDataValue(BigDecimal dataValue) throws Exception {
        if (dataValue == null){
            throw new Exception("dataValue不能为空");
        }
        basicConfig.setDataValue(dataValue);
    }

    @Override
    public void buildFactorGrade(String factorGrade) throws Exception {
        if (factorGrade == null){
            throw new Exception("factorGrade不能为空");
        }
        basicConfig.setFactorGrade(factorGrade);
    }

    @Override
    public void buildMolecularUnit(String molecularUnit) throws Exception {
        if (molecularUnit == null){
            throw new Exception("molecularUnit不能为空");
        }
        basicConfig.setMolecularUnit(molecularUnit);

    }

    @Override
    public void builddEnominatorUnit(String denominatorUnit) throws Exception {
        if (denominatorUnit == null){
            throw new Exception("denominatorUnit不能为空");
        }
        basicConfig.setDenominatorUnit(denominatorUnit);
    }

    @Override
    public void buildUpdateAt(Date updateAt) throws Exception {
        basicConfig.setUpdateAt(updateAt);
    }
}
